package com.qf.redpack.business.web.controller;


import com.qf.redpack.base.R;
import com.qf.redpack.business.web.service.RedpackService;
import com.qf.redpack.entity.Redpack;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 红包表(Redpack)表控制层
 *
 * @author makejava
 * @since 2024-02-02 10:35:21
 */
@RestController
@RequestMapping("/redpack")
public class RedpackController {

    @Autowired
    private RedpackService redpackService;

    /**
     * 发红包的接口
     * @return
     */
    @PostMapping("/send")
    public R sendRedpack(Redpack redpack) {
        System.out.println("发送红包:" + redpack);
        long redId = redpackService.sendRedPack(redpack);
        return R.succ(redId);
    }
}

